﻿<Window x:Class="GurLoader.View.CaptureAreaWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:view="clr-namespace:GurLoader.View"
        Title="CaptureAreaWindow" MinHeight="50" MinWidth="50" Topmost="True"
        WindowStyle="None" ShowInTaskbar="False" AllowsTransparency="True" Background="Transparent">
    <Window.InputBindings>
        <KeyBinding Key="Escape" Command="{Binding CancelCommand}"/>
    </Window.InputBindings>
    <Window.Style>
        <Style TargetType="Window">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Cursor" Value="Cross"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Style>
    <Grid>
        <Image HorizontalAlignment="Stretch" VerticalAlignment="Top" Source="{Binding Image}"/>
        <Rectangle Fill="Black"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity="0.25"/>
        <view:SelectionBackElement 
            Container="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Grid}}" 
            AreaSelectedCommand="{Binding AreaSelectedCommand}"
            SelectionStartPoint="{Binding SelectionStart, Mode=OneWayToSource}"
            SelectionEndPoint="{Binding SelectionEnd, Mode=OneWayToSource}"
            />
    </Grid>
</Window>
